# 打印信息
message(STATUS "src This is BINARY dir " ${PROJECT_BINARY_DIR})
message(STATUS "src This is SOURCE dir " ${PROJECT_SOURCE_DIR})

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

# 定义工程根目录; CMAKE_SOURCE_DIR为内建变量，表示工程根目录的CMakeLists.txt文件路径
SET(ROOT_DIR ${CMAKE_SOURCE_DIR})

# 构建可执行程序
ADD_EXECUTABLE(sample10 main.cpp)

# 查找指定的库
FIND_PACKAGE(CURL)

IF(CURL_FOUND)

    MESSAGE(STATUS ”CURL library ${CURL_INCLUDE_DIR}”)
    MESSAGE(STATUS ”CURL library ${CURL_LIBRARY}”)

    INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
    TARGET_LINK_LIBRARIES(sample10 ${CURL_LIBRARY})

ELSE(CURL_FOUND)

    MESSAGE(FATAL_ERROR ”CURL library not found”)

ENDIF(CURL_FOUND)